{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">短信模板</a>
		</li>
		<li><strong>添加模板</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
				<h5>添加模板</h5>
			</div>
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('add')}">
					<div class="form-group">
						<label class="col-sm-3 control-label">应用场景：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="title" name="title" placeholder="应用场景" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">短信分类：</label>
						<div class="input-group col-sm-4">
							<select name="type" class="form-control">
								<option value="1">验证码</option>
								<option value="2">短信通知</option>
								<option value="3">推广短信</option>
								<option value="4">语音通知</option>
								<option value="5">群发助手</option>
							</select>
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">短信签名：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="sign_name" name="sign_name" placeholder="短信签名" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">模板ID：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="tid" name="tid" placeholder="模板ID" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<label class="col-sm-3 control-label">模板参数：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="params" name="params" placeholder="模板参数" class="form-control" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
							<a href="{:url('index')}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> 返回 </a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script>
	$(function() {
		$("#myForm").validate({
			rules: {
				title: "required",
				sign_name: "required",
				tid: "required",
				params: "required"
			},
			messages: {
				title: ICON.error + "请输入应用场景",
				sign_name: ICON.error + "请输入短信签名",
				tid: ICON.error + "请输入模板ID",
				params: ICON.error + "请输入模板参数"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
{/block}